class Solution {
public:
    vector<int> findNumbersWithSum(vector<int>& nums, int target) {
        unordered_set<int> S;
        for (auto x : nums) {
            if (S.count(target - x)) {
                return {x, target - x};
            }
            S.insert(x);
        }
    }
};
